Squeezing the last bits of performance out of I2p

HowTos, FAQs, Tips & Tricks, & Guides
Post Reply
jogger
Posts: 45
Joined: 19 Feb 2018 09:00

Squeezing the last bits of performance out of I2p

Post by jogger »

This tutorial shows you how to really optimize your libjbigi.

Background: GMP uses generic build parameters for each hardware architecture that you can further optimize for your specific gear.

First shut down any process consuming more than 1% CPU as critical timing loops will be involved.

Step 1

Follow instructions here: https://geti2p.net/de/misc/jbigi to build a static jbigi. Skip step 5 and 8. The last lines of build.sh may be copied to a separate test script for repeated tests. Step 9 is incorrect. Follow the instructions spit out by build.sh. Save test results for further reference.

Step 2

cd gmp-6.1.2
bash configure
make
cd tune
make tuneup
./tuneup

Save the output of tuneup. At the beginning the location of gmp_param.h is noted that will be used for building. Replace the contents of that gmp_param.h by the tuneup output between the comment lines.

cd ..
make distclean
cd ..
bash build.sh

Cool, eh?
jogger
Posts: 45
Joined: 19 Feb 2018 09:00

Re: Squeezing the last bits of performance out of I2p

Post by jogger »

Another stunning performance booster:

To make improvements like the above work most effective one has to make sure processing of individual packets is not preempted by the scheduler. Depending on the number of cores you have and their speed you can do the following (example given for Linux):

su
echo 100000 > /proc/sys/kernel/sched_cfs_bandwidth_slice_us

Use at least twice your ElGamal decrypt value from the stats page. On highly utilized low-end machine you will see throughput increase by 10-20%.
jogger
Posts: 45
Joined: 19 Feb 2018 09:00

Re: Squeezing the last bits of performance out of I2p

Post by jogger »

Addition:

Of course the OP does not only work on Linux, but also on Mac, if you have Dev tools installed (no XCode necessary) and use HomeBrew to install ant and wget. Maybe fiddling with access rights is necessary. The resulting lib is libjbigi.jnilib.
BeaconLilt
Posts: 18
Joined: 05 Dec 2018 02:18

Re: Squeezing the last bits of performance out of I2p

Post by BeaconLilt »

Thanks!
Post Reply